package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.HospitalCampus;
import com.ruoyi.system.domain.TExamItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TExamPackageMapper;
import com.ruoyi.system.domain.TExamPackage;
import com.ruoyi.system.service.ITExamPackageService;

/**
 * 体检套餐主Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-27
 */
@Service
public class TExamPackageServiceImpl implements ITExamPackageService
{
    @Autowired
    private TExamPackageMapper tExamPackageMapper;

    /**
     * 查询体检套餐主
     * 
     * @param id 体检套餐主主键
     * @return 体检套餐主
     */
    @Override
    public TExamPackage selectTExamPackageById(String id)
    {
        return tExamPackageMapper.selectTExamPackageById(id);
    }

    /**
     * 查询体检套餐主列表
     * 
     * @param tExamPackage 体检套餐主
     * @return 体检套餐主
     */
    @Override
    public List<TExamPackage> selectTExamPackageList(TExamPackage tExamPackage)
    {
        return tExamPackageMapper.selectTExamPackageList(tExamPackage);
    }

    /**
     * 新增体检套餐主
     * 
     * @param tExamPackage 体检套餐主
     * @return 结果
     */
    @Override
    public int insertTExamPackage(TExamPackage tExamPackage)
    {
        tExamPackage.setCreateTime(DateUtils.getNowDate());
        return tExamPackageMapper.insertTExamPackage(tExamPackage);
    }

    /**
     * 修改体检套餐主
     * 
     * @param tExamPackage 体检套餐主
     * @return 结果
     */
    @Override
    public int updateTExamPackage(TExamPackage tExamPackage)
    {
        tExamPackage.setUpdateTime(DateUtils.getNowDate());
        return tExamPackageMapper.updateTExamPackage(tExamPackage);
    }

    /**
     * 批量删除体检套餐主
     * 
     * @param ids 需要删除的体检套餐主主键
     * @return 结果
     */
    @Override
    public int deleteTExamPackageByIds(String[] ids)
    {
        return tExamPackageMapper.deleteTExamPackageByIds(ids);
    }

    /**
     * 删除体检套餐主信息
     * 
     * @param id 体检套餐主主键
     * @return 结果
     */
    @Override
    public int deleteTExamPackageById(String id)
    {
        return tExamPackageMapper.deleteTExamPackageById(id);
    }

    @Override
    public List<TExamItem> getallitem()
    {
        return tExamPackageMapper.getallitem();
    }
    @Override
    public int delpackagebyname(String  name){
        return tExamPackageMapper.delpackagebyname(name);
    }
    @Override
    public List<HospitalCampus> listCampus(){
        return tExamPackageMapper.listCampus();
    }

    @Override
    public TExamPackage getpackagebyname(String name) {
        return tExamPackageMapper.getpackagebyname(name);
    }
}
